package com.bykj.property.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.bykj.property.controller.vo.request.PaymentRecordPageRequest;
import com.bykj.property.mapper.provider.DoorCardSql;
import com.bykj.property.mapper.provider.PaymentRecordSql;
import com.bykj.property.model.PaymentRecord;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

/**
* <p>
    * 缴费记录表 Mapper 接口
    * </p>
*
* @author liangyiming
* @since 2019-06-20
*/
public interface PaymentRecordMapper extends BaseMapper<PaymentRecord> {

    @SelectProvider(type= PaymentRecordSql.class, method = "getSql")
                @Results({ @Result(property = "chargeTypeId",column = "charge_type_id"),
                        @Result(property = "pmVillageId",column = "pm_village_id"),
                        @Result(property = "pmUnitId",column = "pm_unit_id"),
                        @Result(property = "pmProprietorId",column = "pm_proprietor_id"),
                        @Result(property = "chargeType",column = "charge_type_id",one = @One(select = "com.bykj.property.mapper.ChargeTypeMapper.selectById"))
                ,@Result(property = "pmVillage",column = "pm_village_id",one = @One(select = "com.bykj.property.mapper.PmVillageMapper.selectById"))
                ,@Result(property = "pmUnit",column = "pm_unit_id",one = @One(select = "com.bykj.property.mapper.PmUnitMapper.selectById"))
                ,@Result(property = "pmProprietor",column = "pm_proprietor_id",one = @One(select = "com.bykj.property.mapper.PmProprietorMapper.selectById"))
    })
    Page<PaymentRecord> queryPage(PaymentRecordPageRequest pageRequest);

}